﻿using Microsoft.EntityFrameworkCore;

namespace Recipes.EntityFrameworkCore.Entities
{
    partial class OrmCookbookContext : DbContext
    {
        //Using "= null!;" to remove the compiler warning.
        //Assume that the DbContext constructor will populate these properties
        public virtual DbSet<EmployeeClassificationKeyHolder> EmployeeClassificationKeyHolder { get; set; } = null!;

        public virtual DbSet<EmployeeClassificationWithCount> EmployeeClassificationWithCount { get; set; } = null!;

        static void RegisterEntitiesForStoredProcedures(ModelBuilder modelBuilder)
        {
            //Output types for stored procedures. Not generated by Scaffold-DbContext

            modelBuilder.Entity<EmployeeClassificationWithCount>(entity =>
            {
                entity.HasNoKey();

                entity.Property(e => e.EmployeeClassificationName).IsUnicode(false);
            });

            modelBuilder.Entity<EmployeeClassificationKeyHolder>(entity =>
            {
                entity.HasNoKey();
            });
        }
    }
}
